#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sqlite3.h>
#include <unistd.h>
#include <fcntl.h>
#include "Element.h"

int main(void){
	int fd=0;
	int val = 0;
	int id;
	while(1){
		fd = open("/dev/MX",O_RDWR);
		if(fd<0){
			printf("can't open\n");
			return -1;
		}
		//write(fd,&id,sizeof(id));
		read(fd,&id,sizeof(id));
		printf("id = %d\n", id);
		close(fd);
		sleep(1);
	}
	return 0;
}